package logic

import (
	"cart_srv/model/redis"
	"context"

	"cart_srv/cart"
	"cart_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CartDetailLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCartDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartDetailLogic {
	return &CartDetailLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CartDetailLogic) CartDetail(in *cart.CartDetailRequest) (*cart.CartDetailResponse, error) {
	// todo: add your logic here and delete this line
	list := redis.Detail(in.UserId, in.GoodsId)
	return &cart.CartDetailResponse{List: list}, nil
}
